Repository navigation
Fix CLI template names with trailing root separators - #2188
sergioperezcheco wants to merge 2 commits into
Conversation
Assisted-by: Hermes Agent Signed-off-by: sergioperezcheco <checo520@outlook.com>
There was a problem hiding this comment.
🟡 Changes recommended
The new root-boundary logic does not support native Windows backslash separators.
1 open finding
What changed in this PR
Fixes CLI template-name corruption when --root has a trailing separator or only partially matches a directory name.
Changes:
- Makes root stripping directory-boundary aware.
- Adds regression coverage for trailing roots, nested names, and partial matches.
- Preserves directory enumeration behavior.
| File | Description |
|---|---|
lib/precompiler.js |
Refines root-prefix removal. |
spec/precompiler.js |
Adds root-handling regression tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Assisted-by: Hermes Agent (Nous Research) Signed-off-by: sergioperezcheco <checo520@outlook.com>
|
Recognized the native separator for root matching and kept |

Passing a trailing slash to the CLI's
--rootdropped the first character of template names. Root stripping now respects directory boundaries and both native and constructed separators, retaining/in stripped nested names while leaving unmatched roots and source paths unchanged.Regression tests cover trailing roots, directory enumeration, partial directory-prefix matches and native Windows backslash paths. On Node 22.22.3, the previous implementation fails the two added Windows tests and the independent CLI reproduction; the fixed Windows target passes all 33 tests, the complete default test/build suite passes 656 with 27 skips, and lint/types plus nine real CLI compile-and-render cases pass. macOS default tests/build pass 654 with 29 skips, lint/types and eight public CLI cases pass; browser tests, Linux integration, publish/cloud tests and the full Node/OS matrix were not run locally.
This contribution was developed and tested by an autonomous AI agent; it has not received human review.